package top.gbyun.node.stander;

import lombok.extern.slf4j.Slf4j;
import top.gbyun.core.api.BasicNode;
import top.gbyun.core.api.NodeConfig;
import top.gbyun.core.api.NodeContext;
import top.gbyun.core.api.NodeStructure;
import top.gbyun.core.msg.NodeMsg;

/**
 * @author gengbin
 * @date 2024-12-26-15:43
 */
@Slf4j
@NodeStructure(
        type = "stander",
        name = "标准节点",
        info = "标准节点",
        details = "标准节点",
        configClazz = StanderInputNodeConfig.class,
        inEnabled = true,
        outEnabled = true,
        relationTypes = {"SUCCESS"},
        uiResources = {"/node/stander/stander.js", "/node/stander/stander.css"},
        configDirective = "stander-config",
        icon = "stander.svg")
public class StanderInputNode implements BasicNode {

    private StanderInputNodeConfig config;

    /**
     * 节点创建事件
     *
     * @param nodeCtx
     * @param config
     * @return void
     * @author gengbin
     * @date 2024/12/20 17:55
     */
    @Override
    public void onCreate(NodeContext nodeCtx, NodeConfig config) {
        this.config = config.getConfig().toJavaObject(StanderInputNodeConfig.class);

    }

    /**
     * 节点消息事件
     *
     * @param nodeCtx
     * @param message
     * @return void
     * @author gengbin
     * @date 2024/12/20 17:55
     */
    @Override
    public void onMessage(NodeContext nodeCtx, NodeMsg message) {
        //nodeCtx.send("123");
    }

    /**
     * 节点销毁事件
     *
     * @return void
     * @author gengbin
     * @date 2024/12/20 17:55
     */
    @Override
    public void onDestroy() {

    }
}
